<?php

namespace App\Http\Requests\ApiV2;

class EquipmentRequest extends BaseRequest
{
    public function rules()
    {
        return [
            'equipmentCode' => 'required',
            'equipmentName' => 'required',
            'brand' => 'required',
            'model' => 'required',
            'location' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'equipmentCode.required' => __('设备编码必须有'),
            'equipmentName.required' => __('设备名称必须有'),
            'brand.required' => __('品牌必须有'),
            'model.required' => __('规格型号必须有'),
            'location.required' => __('存放位置必须有'),
        ];
    }

    public function filldata()
    {
        return [
            'equipmentCode' => $this->input('equipmentCode'),
            'equipmentName' => $this->input('equipmentName'),
            'brand' => $this->input('brand'),
            'model' => $this->input('model'),
            'location' => $this->input('location'),
            'remark' => $this->input('remark'),
        ];
    }
}
